package com.lqjava.flowable.serverapp.sys.config.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
/**
 * Api核心配置
 * 指定哪些接口需要用到拦截器
 * @author lq 2021年3月21日 19:15:22
 */
@Configuration
public class ApiWebMvcConfiguration extends WebMvcConfigurationSupport {

	@Autowired
	ApiLoginInterceptor wechatInterceptor;
	
    public void addInterceptors(InterceptorRegistry registry) {
        registry
    		.addInterceptor(wechatInterceptor)
            //添加拦截
            .addPathPatterns("/**")
            //排除拦截
            .excludePathPatterns("/error")
            .excludePathPatterns("/open/**")
        ;
        super.addInterceptors(registry);
    }

}
